<?php 
/*
  // Output all flash messages (see my method addFlashMsg() in app_controller)
  $messages = $this->Session->read('Message.multiFlash');
  // if there are flash messages to be displayed
  if($messages || $this->Session->check('Message.flash')) { // then output the div#messages...
    // wrapper for the flash messages
    echo "<div id='messages' class='modal onload'>";

        // the standard messages
        echo $this->Session->flash();
        // multiple messages
        if($messages = $this->Session->read('Message.multiFlash')) {
          foreach($messages as $k=>$msgArray) {
            echo $this->Session->flash('multiFlash.'.$k); // uses my Cake 'element' customFlashMessage
          }
        }
    echo "</div>"; // end div#messages
  } // end if there are flash messages to be displayed
 
 */

  // if there are flash messages to be displayed
  if(isset($flashMessages)) { // then output the div#messages...
    // wrapper for the flash messages
    echo "<div id='AjaxMessages' class='modal'>";
    //echo "<div id='AjaxMessages' class='modal purrMessage'>";
      foreach($flashMessages as $msgClass=>$msgArray) {
        
        foreach($msgArray as $msg) {
          // TODO: test for each msg type (i.e., 'error', etc) and display the msg in proper div with a class
          echo "<div class='{$msgClass}'>$msg</div>"; 
        }
      }
        // manually adding a close link since the Purr one isn't working
        //echo '<a id="close" href="#close">Close</a>';
    echo "</div>"; // end div#AjaxMessages
  }
?>


<applet id="applet"
        codebase=<?="\"". GlobalsClass::getFijiSignedAppletFullPath() ."\"" ?>
        code="ij.ImageJApplet.class" archive="imageJ.jar"
        width="0" height="0" 
        security="all-permissions">         
    
  <!-- Note: For the ImageJ version of the applet, it seems to need an absolute path for image params.
             If using the ImageJA version applet, it seems to need a relative path for image params.
  -->      

  
  <!--
  <param name="url1" value="http://localhost/imagerecon/_Images/TestImages/Desert.jpg"/>
  <!--
  <param name="url1" value="../../../_Images/TestImages/Desert.jpg"/>
  -->
  
  <?php
      //debug($imagePaths);
  // create image params for the applet
  $i = 1;
  foreach($imagePaths as $imagePath):
    $url = 'url' . $i;
    ?>
    <param name=<?="\"$url\""?> value=<?="\"$imagePath\""?>/>

    <?php
    $i++;
  endforeach;
  ?>
  
  <!--
  <param name="eval1" value='run("Brightness/Contrast..."); 
                             run("Enhance Contrast", "saturated=0.35");
                             run("Put Behind [tab]");
                             run("Next Slice [>]");
                             run("Enhance Contrast", "saturated=0.35");
                             '/>  
  -->
  <!--
  <param name="eval1" value='run("Brightness/Contrast..."); 
                             run("Enhance Contrast", "saturated=0.35");
                             '/>  
  -->

  <!-- From: http://www.med.harvard.edu/JPNM/ij/applets/parker.html -->
  <!--
  <param name=adjustBrightnessContrast value=true />
  -->
    
</applet>